clear
clear all
cap log close

log using "log-files/2_Figure_C1.smcl", replace smcl

timer on 2

*------------*
* Figure C.1 *
*------------*
	* Figure C.1.a
	*-------------
		use "data/outputs/computo_verificadortrepdate_nomissings.dta", clear	

		twoway (scatter mshare_so pcs_so, msymbol(p) msize(vsmall) mcolor(gs10)) ///
			(lowess mshare_so pcs_so if pcs_so < .95, mean bw(.3) ///
				lcolor(midblue) lwidth(thick)) ///
			(lowess mshare_so pcs_so if pcs_so >= .95, mean bw(.6) ///
				lcolor(midblue) lwidth(thick)), ///
			xline(0.95, lcolor(black)) ///
			yline(0.5, lcolor(black)) ///
			xsize(7) ysize(4.7) ///
			ytitle("Polling-Station-Level MAS Vote Share") ///
			xtitle("Proportion of Preliminary Vote Counted") ///
			graphregion(color(white)) legend(off) ///
			ylabel(0 "0" .2 "20" .4 "40" .6 "60" .8 "80" 1 "100", angle(0)) ///
			xlabel(0 "0" .95 ".95" 1 "1", angle(0))
		graph export "outputs/generated/Figure_C1a.png", replace

	* Figure C.1.b
	*-------------
		use "data/outputs/computo_verificadortrepdate_missingsatthend.dta", clear	

		twoway (scatter mshare_so pcs_so, msymbol(p) msize(vsmall) mcolor(gs10)) ///
			(lowess mshare_so pcs_so if pcs_so < .95, bw(0.3) lcolor(midblue) ///
				lwidth(thick)) ///
			(lowess mshare_so pcs_so if pcs_so >= .95, bw(0.6) lcolor(midblue) ///
				lwidth(thick)), ///
			xline(0.95, lcolor(black)) ///
			yline(0.5, lcolor(black)) ///
			xsize(7) ysize(4.7) ///
			ytitle("Polling-Station-Level MAS Vote Share") ///
			xtitle("Proportion of Preliminary Vote Counted") ///
			graphregion(color(white)) legend(off) ///
			ylabel(0 "0" .2 "20" .4 "40" .6 "60" .8 "80" 1 "100", angle(0)) ///
			xlabel(0 "0" .95 ".95" 1 "1")
		graph export "outputs/generated/Figure_C1b.png", replace

*------------------------------------------------------------------------------*
timer off 2
timer list 2

log close
clear all
